<template>
  <div class="content-details">
    <div class="header">
      <el-button class="btn1" type="primary" @click="$router.push({name:'myexam'})"
        >返回</el-button
      >
      <p class="right">总成绩:100</p>
      <p class="left">科目:Java</p>
    </div>
    <el-container style="height: 850px; border: 1px solid #eee">
      <el-aside
        width="200px"
        style="background-color: rgb(238, 241, 246); height: 850px"
      >
        <el-menu :default-openeds="['1', '2', '3']">
          <el-submenu v-for="item in examLists" :key="item.id" :index="item.id">
            <template slot="title"
              ><i class="el-icon-message"></i>{{ item.name }}</template
            >
            <el-menu-item-group
              v-for="question in item.question"
              :key="question.id"
              :index="question.flag"
            >
              <el-menu-item @click="jumpQuestion(item.name, question.name)">{{
                question.name
              }}</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <MyExamList
          :questionDetail="questionDetail"
          :examListName="examListName"
        >
          <template v-slot:questionDetail> </template>
        </MyExamList>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import MyExamList from "./MyExamList.vue";
export default {
  name: "ExamMan",
  data() {
    return {
      examListName: [],
      questionDetail: [],
      examLists:[],
    }
  },
  mounted() {
    console.log(this.$route);
  },
  computed: {
    index() {
      for (let i = 0; i < this.arr.length; i++) {
        return arr[i];
      }
    },
  },
  components: {
    MyExamList,
  },
  methods: {
    jumpQuestion(name0, name1) {
      this.examListName = this.examLists.filter((item) => item.name === name0);
      this.questionDetail = this.examListName[0].question.filter(
        (item) => item.name === name1
      );
      // console.log(this.questionDetail);
    },
  },
};
</script>

<style lang="scss" scoped>
.content-details {
  .header {
    width: 100%;
    height: 60px;
    margin-bottom: 10px;

    .left {
      font-size: 30px;
      width: 20%;
      height: 50px;
      line-height: 50px;
      text-align: center;
      float: right;
      margin: 0;
    }

    .right {
      font-size: 30px;
      width: 40%;
      height: 50px;
      line-height: 50px;
      text-align: center;
      float: right;

      margin: 0;
    }

    .btn1 {
      line-height: 20px;
      text-align: center;
      float: right;
      margin-right: 10px;
    }
  }
  .el-header {
    background-color: #b3c0d1;
    color: #333;
    line-height: 60px;
  }

  .el-aside {
    color: #333;
  }
  // ::v-deep .el-tabs__item {
  //   height: 100px;
  //   font-size: 20px;
  // }
  // ::v-deep .el-tabs__content {
  //   width: 73%;
  //   height: 100%;
  //   padding-left: 30px;
  //   font-size: 28px;
  //   // overflow: auto;
  //   .container {
  //     width: 100%;
  //     height: 100%;
  //     margin-top: 20px;
  //     .radio {
  //       width: 100%;
  //       height: 30px;
  //       text-align: left;
  //       line-height: 30px;
  //       .el-radio__label {
  //         font-size: 20px;
  //       }
  //     }
  //     .checkbox {
  //       width: 100%;
  //       height: 30px;
  //       text-align: left;
  //       line-height: 30px;
  //       .el-checkbox__label {
  //         font-size: 20px;
  //       }
  //     }
  //     .daan {
  //       width: 50%;
  //       height: 30px;
  //       font-size: 24px;
  //       // background-color: blue;
  //       margin-top: 20px;
  //     }
  //     .parse {
  //       width: 100%;
  //       height: 100px;
  //       background-color: blue;
  //       margin-top: 10px;
  //     }
  //   }
  // }
}
</style>